package com.newdjk.newdoctor.adapter;


import android.text.TextUtils;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.google.gson.Gson;
import com.newdjk.newdoctor.MyApplication;
import com.newdjk.newdoctor.R;
import com.newdjk.newdoctor.utils.GlideUtils;
import com.newdjk.okhttp.entity.HotShopEntity;
import com.newdjk.okhttp.entity.SpecialAdviceEntity;

import java.util.List;

public class TeseAdviceAdapter extends BaseQuickAdapter<SpecialAdviceEntity.ReturnDataBean, BaseViewHolder> {
    private String TAG = "MyDiagnoseImageAdapter";
    private Gson mGson;
    private List<SpecialAdviceEntity.ReturnDataBean> datalist;
    private int type = 0;


    public TeseAdviceAdapter(@Nullable List<SpecialAdviceEntity.ReturnDataBean> data) {
        super(R.layout.spc_advice_item, data);

        datalist = data;
        mGson = new Gson();
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, final SpecialAdviceEntity.ReturnDataBean item) {

        ImageView avatar = helper.getView(R.id.im_picture);

        GlideUtils.loadMedicaineCommonmage(item.getMasterPictureThumb(), avatar);
        String hospiitical = item.getOrgName();
        String serviceName = item.getServicePackName();
        int count = item.getRecommendNum();
        String price = item.getOriginalPrice();
        String serviceprice = item.getRecommendAmount();
        helper.setText(R.id.tv_hospitical_name, TextUtils.isEmpty(hospiitical)?"":hospiitical);
        helper.setText(R.id.tv_package_name,  TextUtils.isEmpty(serviceName)?"":serviceName);
        helper.setText(R.id.tv_advice_count, count + "人已推荐");
        helper.setText(R.id.tv_price, "价格：￥"+price + "");
        helper.setText(R.id.tv_service_price, "服务费：￥"+(TextUtils.isEmpty(serviceprice)?"":serviceprice) + "");


    }
}
